package com.sinosoft;

import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author loujiang
 * @date 2020/12/21 1:49 下午
 * @NOTE:
 */

@SpringBootApplication
public class RibbonConsumerApplication {


    public static void main(String[] args) {
        new SpringApplicationBuilder(RibbonConsumerApplication.class).
                web(WebApplicationType.SERVLET)
                .run(args);
    }

    @Bean
    //负载均衡注解
    @LoadBalanced
    public RestTemplate   restTemplate()
    {
        return  new RestTemplate();
    }
}
